package com.haredot.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "tb_user_score")
public class UserScore {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 积分来源
     */
    @TableField(value = "action")
    private String action;

    /**
     * 积分
     */
    @TableField(value = "score")
    private Integer score;

    /**
     * 资源ID
     */
    @TableField(value = "res_id")
    private Long resId;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 录入时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;

    /**
     * 删除标记
     */
    @TableField(value = "del")
    @TableLogic(value = "0", delval = "1")
    private Boolean del;
}